// https://codeforces.com/contest/1316/submission/156836529
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1e5 + 5;
int dp[M][(1 << 7) + 1], skill[M][7];
int ind[M], a[M];

signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, p, k;
  memset(dp, -1, sizeof(dp));
  cin >> n >> p >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < p; ++j) cin >> skill[i][j];
  for (int i = 1; i <= n; ++i) ind[i] = i;

  sort(ind + 1, ind + n + 1, [](int p, int q) { return a[p] > a[q]; });

  dp[0][0] = 0;
  for (int i = 1; i <= n; ++i) {
    int x = ind[i];
    for (int mask = 0; mask < (1 << p); ++mask) {
      // 1. 选为第 p 位球员的情况
      for (int j = 0; j < p; ++j)
        if (mask & (1 << j) && dp[i - 1][mask ^ (1 << j)] != -1)
          if (int z = dp[i - 1][mask ^ (1 << j)] + skill[x][j]; z > dp[i][mask])
            dp[i][mask] = z;

      // 已经选了 z 名观众可用该方法计算
      int z = (i - 1) - __builtin_popcountll(mask);
      // 2. 选为观众的情况
      if (z < k) {
        // 观众未满将这位选为观众
        if (dp[i - 1][mask] != -1)
          dp[i][mask] = max(dp[i][mask], dp[i - 1][mask] + a[x]);
      } else {
        // 观众已满，不能将这位选为观众，但要更新DP数组
        if (dp[i - 1][mask] != -1)
          dp[i][mask] = max(dp[i][mask], dp[i - 1][mask]);
      }
    }
  }
  cout << dp[n][(1 << p) - 1] << "\n";
  return 0;
}
